package com.mdx.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mdx.bean.DiseaseBean;
import com.mdx.bean.RodentBean;
import com.mdx.dao.RodentDao;
import com.mdx.service.IRodentService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class RodentServiceImpl extends ServiceImpl<RodentDao, RodentBean> implements IRodentService {
    @Override
    public IPage<RodentBean> findByName(int pageNO, int pageSize, String rodentName) {
        IPage<RodentBean> page = new Page<>(pageNO,pageSize);
            QueryWrapper wrapper = new QueryWrapper();
            if (rodentName != null && !rodentName.equals("")){
                wrapper.like("f_rodentName",rodentName);
            }
            IPage<RodentBean> iPage = this.page(page,wrapper);
        return iPage;
    }
}
